#pragma once
#include <vector>
#include "Card.h"
#include "Player.h"

namespace MemorySpace
{
	class Memory
	{
	private:
		std::vector<Player> *pv;
		std::vector<std::vector<Card>> *cvv;
		int r, c, p, turn;

		//Initializes the matrix for the board and fills it with cards
		void createBoard();
		//Initializes the vector containing the players and asks for their name in console
		void createPlayers();
		//Handles the players input and moves the cursor around during a turn
		void inputHandler(int &x, int &y);
		//Sorts the vector containing players base on their score in descending order
		void sortPlayers();
		//Handles a player taking a turn
		void playerTurn();
		//Draws the board to the console
		void drawBoard();
		//Returns true if there are still cards not facing up on the board
		bool movesLeft();
		//Prints the end screen containing scores for all players
		void printEndScreen();

	public:
		Memory();
		~Memory();

		void runGame();
	};
}